<?php
$id=$_GET["id"];
//连接
$conn = new mysqli("localhost","root","root","mydb3");
if($conn->connect_error){
    die("连接失败");
}
//连接成功
// $sql = "SELECT * FROM `user`";
//查询name里面带小的字段
//$sql="SELECT * FROM 'user' WHERE 'name' LIKE '%小%' ";
//查询mydb3的user表中的id=3的值
$sql="SELECT * FROM `user` WHERE `id` =$id ";
$result = $conn->query($sql);
 
//如果数据库里的条数大于1
if($result->num_rows > 0){
    //有值
    while($row = $result->fetch_assoc()){
        var_dump($row["name"]);
    }
}else{
    echo "0 结果";
}

//关闭连接
$conn->close();

?>